package com.k2data.k2app.controller;

import com.k2data.k2app.response.CommonResultResponse;
import com.k2data.k2app.response.ResponseHelper;
import com.k2data.k2app.service.KmxService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <pre>
 * 分析任务
 * Created by clb on 17-3-17.
 * </pre>
 */
@Api(description = "分析任务")
@RestController
@RequestMapping("/templates")
public class TemplateController {
    @Autowired
    private KmxService kmxService;

    @ApiOperation(value = "设备类型是否已经同步")
    @ApiImplicitParam(name = "fieldGroup", value = "fieldGroup", required = true, dataType = "String", paramType = "query")
    @GetMapping(value = "/fieldGroup/status")
    public ResponseEntity<CommonResultResponse> run(@RequestParam(value = "fieldGroup", required = false) String fieldGroup) throws Exception {
        return ResponseHelper.success(kmxService.fieldGroupExist(fieldGroup));
    }
}
